Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ


Displaying Rendered β€’ View raw β€’ Download

.specify/extensions/brownfield/README.md 4e48e64e786b58d7c73280f7aa6ebf55be9e53e5 (4e48e64e) Text, 6.13 KB

spec-kit-brownfield

A Spec Kit extension that bootstraps Specification-Driven Development for existing codebases β€” auto-discover architecture, generate a tailored constitution, and incrementally migrate features into the SDD workflow.

Problem

Spec Kit's T383838specify init creates generic templates that don't fit established projects. Teams with existing codebases face friction adopting SDD:

β€’ Generic constitution doesn't reflect actual tech stack, architecture, or conventions
β€’ Templates reference placeholder paths instead of real project modules
β€’ Multi-module projects (monorepos) get no guidance on code boundaries
β€’ No way to bring existing features into the SDD workflow retroactively
β€’ Manual constitution creation is tedious and error-prone for large codebases

Solution

The Brownfield Bootstrap extension adds four commands for adopting spec-kit in existing projects:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Command β”‚ Pu… β”‚ Modifies Files? β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ T383838/speckit.brownfield.scan β”‚ Au… β”‚ No β€” read-only β”‚
β”‚ T383838/speckit.brownfield.bootstrap β”‚ Ge… β”‚ Yes β€” creates/updates constitution, templates, AGENTS.md β”‚
β”‚ T383838/speckit.brownfield.validate β”‚ Ve… β”‚ No β€” read-only β”‚
β”‚ T383838/speckit.brownfield.migrate β”‚ In… β”‚ Yes β€” creates spec.md, plan.md, tasks.md for existing fea… β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Installation

T282828
specify extension add --from https://github.com/Quratulain-bilal/spec-kit-brownfield/archive/refs/tags/v1.0.0.zip

How It Works

Phase 1: Discover

T383838/speckit.brownfield.scan analyzes your codebase to build a project profile:

T282828
Project Profile
β”œβ”€β”€ Tech Stack: TypeScript (68%), Python (32%)
β”œβ”€β”€ Frontend: React 18, Vite, TailwindCSS
β”œβ”€β”€ Backend: FastAPI, SQLAlchemy, PostgreSQL
β”œβ”€β”€ Architecture: Frontend + Backend (separated)
β”œβ”€β”€ Modules: client/, server/, shared/
β”œβ”€β”€ Testing: Jest (frontend), pytest (backend)
β”œβ”€β”€ CI/CD: GitHub Actions
β”œβ”€β”€ Branch Pattern: feat/*, fix/*, chore/*
└── Conventions: kebab-case (frontend), snake_case (backend)

Phase 2: Configure

T383838/speckit.brownfield.bootstrap generates spec-kit configuration from the profile:

β€’ Constitution: Rules derived from actual codebase conventions β€” not generic boilerplate
β€’ Spec template: Project-specific sections (e.g., "Database Migrations" for ORM projects)
β€’ Plan template: Module-aware implementation phases (e.g., frontend/backend split)
β€’ Tasks template: Real test commands and build steps from your actual toolchain
β€’ AGENTS.md: Agent boundaries for multi-module projects

Phase 3: Verify

T383838/speckit.brownfield.validate checks that configuration matches reality:

β€’ Verifies all directory references actually exist
β€’ Confirms mentioned frameworks are in dependency files
β€’ Samples files to validate naming convention rules
β€’ Detects drift if project has changed since bootstrap

Phase 4: Migrate

T383838/speckit.brownfield.migrate brings existing features into SDD:

β€’ Reverse-engineers spec.md from code behavior and test cases
β€’ Reconstructs plan.md from actual implementation patterns
β€’ Generates tasks.md with all tasks marked complete
β€’ Identifies gaps: missing tests, error handling, documentation

Workflow

T282828
specify init ← Initialize spec-kit (if not already done)
β”‚
β–Ό
/speckit.brownfield.scan ← Discover tech stack and architecture
β”‚
β–Ό
/speckit.brownfield.bootstrap ← Generate tailored configuration
β”‚
β–Ό
/speckit.brownfield.validate ← Verify configuration accuracy
β”‚
β–Ό
/speckit.brownfield.migrate ← Bring existing features into SDD
β”‚
β–Ό
/speckit.specify ← Start new features with project-aware templates

Supported Project Types

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Type β”‚ Detection β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Monolith β”‚ Single source tree, one entry point β”‚
β”‚ Monorepo β”‚ Workspace config, T383838packages/ or T383838apps/ directories β”‚
β”‚ Microservices β”‚ Multiple Dockerfiles, service directories β”‚
β”‚ Frontend + Backend β”‚ Separate T383838client//T383838server/ directories β”‚
β”‚ Library/Package β”‚ T383838setup.py, T383838lib/ directory, published package config β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Supported Tech Stacks

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Category β”‚ Detected β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Languages β”‚ TypeScript, JavaScript, Python, Go, Java, Rust, C#, Ruby, PHP β”‚
β”‚ Frontend β”‚ React, Vue, Angular, Svelte, Next.js, Nuxt β”‚
β”‚ Backend β”‚ Express, FastAPI, Django, Spring, Rails, Gin, ASP.NET β”‚
β”‚ Databases β”‚ PostgreSQL, MySQL, MongoDB, SQLite, Redis β”‚
β”‚ Package managers β”‚ npm, yarn, pnpm, pip, Poetry, Go modules, Cargo, Maven, Gradle β”‚
β”‚ CI/CD β”‚ GitHub Actions, GitLab CI, CircleCI, Jenkins β”‚
β”‚ Testing β”‚ Jest, pytest, Go test, JUnit, RSpec, PHPUnit β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Hooks

The extension registers an optional hook:

β€’ after_init: Offers to scan the project after T383838specify init to auto-detect conventions

Design Decisions

β€’ Scan before bootstrap β€” configuration is always derived from actual codebase analysis, never guessed
β€’ Confirm before writing β€” bootstrap and migrate always show a plan and wait for approval
β€’ Merge, don't replace β€” if constitution or templates already exist, merge changes rather than overwriting
β€’ Mark migrated specs β€” reverse-engineered specs include T383838status: migrated to distinguish from fresh specs
β€’ Gap reporting β€” migrate command actively identifies missing tests, error handling, and documentation
β€’ Module-aware β€” all commands understand monorepo and multi-module project structures

Requirements

β€’ Spec Kit >= 0.4.0
β€’ Git >= 2.0.0

Related

β€’ Issue #1436 β€” Brownfield Bootstrap: SDD Workflow for Existing Projects (30+ reactions)

License

MIT

Served by rngit 1.5.2 - Generated in 0.06s